package com.amin.app.web.service;

import com.amin.app.web.entity.RoleMenu;
import com.amin.app.web.mapper.RoleMenuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class RoleMenuService {
    final
    RoleMenuMapper roleMenuMapper;

    public RoleMenuService(RoleMenuMapper roleMenuMapper) {
        this.roleMenuMapper = roleMenuMapper;
    }

    public List<RoleMenu> getMenuListByRoleId(Integer roleId) {
        return roleMenuMapper.getMenuListByRoleId(roleId);
    }

    public void delById(Integer roleId) {
        roleMenuMapper.delById(roleId);
    }

    public void save(Integer menuId, Integer roleId, Date createdTime) {
        roleMenuMapper.save(menuId,roleId,createdTime);
    }
}
